-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add allowed ip check #605
Add allowed ip check #605
Conversation
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like a good PR, but I'm concerned about system tests. See the test output:
one or more errors found in documents stored in metrics-aws.ec2_metrics-ep data stream: [0] parsing field value failed: the IP "3.84.55.9" is not one of the allowed test IPs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the only one left thing is adjusting pipeline tests?
I think you have to update pipeline tests for the AWS test package. |
/test |
5c1a6d2
to
c96514e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
func initializeAllowedIPsList() map[string]struct{} { | ||
m := map[string]struct{}{ | ||
"0.0.0.0": {}, "255.255.255.255": {}, | ||
"0:0:0:0:0:0:0:0": {}, "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff": {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this testing takes output from the net package, this should also probably have "::" since an IPv6 address renders as the abbreviation.
} | ||
|
||
if v.enabledAllowedIPCheck && !v.isAllowedIPValue(valStr) { | ||
return fmt.Errorf("the IP %q is not one of the allowed test IPs", valStr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if this emitted a link to the list of acceptable IPs.
To identify any IP in the testing value that is not in the supported Maxmind's allowed set (found here https://github.com/elastic/elastic-package/blob/master/docs/howto/ingest_geoip.md) a validation check is added at test time.
Will output something similar to